HOME BLOG GITHUB
Storing Numbers Storing Information on a Computer Storing Information on a Computer Storing Songs Storing Songs Storing Information on a Computer->Storing Songs Storing Images Storing Images Storing Information on a Computer->Storing Images Storing Characters Storing Characters Storing Information on a Computer->Storing Characters Storing Numbers Storing Numbers Storing Information on a Computer->Storing Numbers Computer Memories Computer Memories Storing Information on a Computer->Computer Memories Data Types Data Types Storing Numbers->Data Types Number Encodings Number Encodings Storing Numbers->Number Encodings Negative Numbers Negative Numbers Number Encodings->Negative Numbers Fractional Numbers Fractional Numbers Number Encodings->Fractional Numbers

October 05, 2020

Storing Numbers

We need data types and encodings.

Computer memories are based on physical and electrical principles that only allow to store two states. These states are represented by convention with 0 and 1. It is called a binary state.

Only one numeric system allows to count with two digits: the binary system.

  • We need a way to encode these numbers in order to store and retrieve the correct information. Let's say our memory is a sheet of paper containing a row of squares, with each square being able to contain a digit (from 0 to 9). If we want to store the number 17 and then the number 5, we can write the following digits into our row of squares: 1, 7, 5. But then, if someone else comes and reads this "paper memory", how does he know we stored 17 and 5, and not 175? or 1 and 75? To answer these questions, we use Data Types.

  • How to convert any number (integer, negative integer, fractional) into a form of binary representation (using only 0s and 1s)? This is the subject of Number Encodings.